import System
import Growl.Connector

class Notifier:
            growl as GrowlConnector
            notificationTypeSucces as NotificationType
            notificationTypeFailure as NotificationType
            application as Application

            def constructor():
                         RegisterGrowl()

            def RegisterGrowl() as GrowlConnector:
                         growl = GrowlConnector()
                         notificationTypeSucces = NotificationType("SAMPLE_NOTIFICATION", "Notification Succes")
                         notificationTypeFailure = NotificationType("SAMPLE_NOTIFICATION2", "NotificationFailure")
                         application = Application("Khebbie build notifier")
                         notificationList = (notificationTypeSucces, notificationTypeFailure)
                         growl.Register(application, notificationList)                
                         return growl

            def Notify(title as string, message as string):
                                     notification = Notification(application.Name, notificationTypeSucces.Name, DateTime.Now.Ticks.ToString(),
                                                title, message);
                                     growl.Notify(notification)
            def NotifyFailure(title as string, message as string):
                                     notification = Notification(application.Name, notificationTypeFailure.Name, DateTime.Now.Ticks.ToString(),
                                                title, message);
                                     growl.Notify(notification)